package dongshi.daddy.main;

import dongshi.daddy.service.MyProviderStubService;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class ConsumerWithProviderStubMain {
    public static void main(String[] args) {
        ClassPathXmlApplicationContext context
                = new ClassPathXmlApplicationContext("consumer-with-provider-sub.xml");
        context.start();
        MyProviderStubService myProviderStubService = (MyProviderStubService) context.getBean("myStubServiceInProviderSide");
        // 调用服务提供者的存根返回数据
        System.out.println(myProviderStubService.sayHi("222"));
        // 调用服务提供者的真实类获取数据
        System.out.println(myProviderStubService.sayHi("provider stub"));
    }
}
